
<div id="list-boards">
  <div class="container">
    <?php
    if($boards){
       foreach($boards as $board){
    
    ?>
	<div class="col-md-3">
    	<div class="wrapper_board">
            
        	    <div class="board_title">
                    <div class="account_display_extensions_board">
                        <a href="/pinterest/Users/view/<?php echo $board['Profile']['user_id'];?>">
                        <?php
                            echo $this->Html->image($board['Profile']['avatar'],array(
                                                                        'alt'=>'CakePHP',
                                                                        'class'=>'img_display_extensions',
                                                                        'width'=>'100%',
                                                                        'height'=>'100%'));
                        ?>
                        <p><?php echo $board['Board']['name']."(".$board['Profile']['name'].")" ?></p>
                        </a>
                    </div> 
                	
               	</div>

            <a href="/pinterest/Boards/viewInfoBoard/<?php echo $board['Board']['id']; ?>">
               	<div class="big_board">
                    <?php
                        if($board['ImageInBoard'])
                            echo $this->Html->image($board['ImageInBoard'][0]['Image']['url'],
                                                array(
                                                    'alt'=>'CakePHP',
                                                    'width'=>'100%',
                                                    'height'=>'100%'));
                    ?>
                	<!--<img width="100%" height="100%" src="images/img_test.jpg">-->
               	</div>
               	<div class="smalls_board">
                    <?php
                        for($i=1; $i<5; $i++){
                    ?>
                	<div class="wrapper_small_board">
                        <?php
                            if($i < count($board['ImageInBoard']))
                                echo $this->Html->image($board['ImageInBoard'][$i]['Image']['url'],
                                                    array(
                                                        'alt'=>'CakePHP',
                                                        'width'=>'100%',
                                                        'height'=>'100%'));
                        ?>
                		<!--<img width="100%" height="100%" src="images/img_test.jpg">-->
                	</div>
                	<?php } ?>
               </div>
            </a>


            <div class="functions">
                
                <?php
                    switch ($board['boardAction']) {
                        case 1:
                        ?>
                        <a href="/pinterest/Boards/editInfoBoard/<?php echo $board['Board']['id']; ?>">
                            <button>
                                <p>
                                <?php echo "Edit"; ?>
                                </p>
                            </button>
                        </a>
                        <?php
                            break;
                        case 2:
                        ?>
                        <a href="/pinterest/UserFollows/followBoard/<?php echo $board['Board']['id']; ?>">
                            <button>
                                <p>
                                <?php echo "Follow"; ?>
                                </p>
                            </button>
                        </a>
                        <?php
                            break;
                        case 3:
                        ?>
                        <a href="/pinterest/UserFollows/unfollowBoard/<?php echo $board['Board']['id']; ?>">
                            <button>
                                <p>
                                <?php echo "Unfollow"; ?>
                                </p>
                            </button>
                        </a>
                <?php
                    }
                ?>       
                
            </div>
        </div>
    </div>
    <?php
        }
     }else{
        echo "Khong co";
     }
    ?>
  </div>
</div>
